Skip to content

fork-ci release test: call each installer's own checks, stage desk and copy heavy, notice every kit (#921) - #940

Merged
scuttletoby merged 3 commits into
mainfrom
fork-ci/release-test-installer-checks
Nov 22, 2026
Merged

scuttletoby merged 3 commits into
mainfrom
fork-ci/release-test-installer-checks

Conversation

@scuttletoby

Copy link
Copy Markdown
Owner

What and why

The four follow-ups the two #920 lenses asked for on .github/scripts/fork-ci-release.test.py (the check that every kit installs from a release commit):

  1. Installers' own file checks. heavy, model-guard, gh-apps and pc-agents get a small missing_sources(source) (as desk-install has). Each installer refuses with it, and the release test calls it instead of its own copy of each loop, so the test cannot drift from the installer. pc-agents setup now refuses a source without a code file before it writes anything ("refused, nothing changed"). Before, it stopped half-way through the copy with a traceback.
  2. Staging and self-test on the release. Under a throwaway PREFIX, the test runs heavy's copy_tool plus its self-test on the release folder. heavy's self-test is now its own self_test(dest); install calls the same function. The test also runs desk's stage and its self-test. A copied script that starts loading a file the release lacks now fails here, not at install.
    • desk's self-test runs fork-fleet.py gate. With no fleet environment the gate refuses, and it SIGKILLs the nearest Runner.Worker among its parents, which in CI is the job running this test. The test points desk's python3 at a 6-line shim that runs each staged script with os.getppid() == 1, so the gate finds no worker and only reports. I checked this locally under a fake Runner.Worker parent: with the shim the parent survives; without it the parent is killed (exit 137).
  3. Every kit is noticed. Every fork-kit/ folder needs a row in KITS, or in NO_INSTALLER (common, review). Before, only a folder with sbin/ counted. Each row now also records the --source its bootstrap passes, and the test reads the kit's bootstrap.sh (or its arm in the shared common/bootstrap.sh) and checks the installer path and --source against the row. The file check then runs with that --source.
  4. Failure messages name the cause: a path missing from the release ("add the path(s) to … paths"), a missing or wrong test row, the installer's self-test failing, or a check that did not run. Only the first gets the paths advice.

The test now also deletes its temp folder when it ends. Each run used to leave 13–30 MB in /tmp, more with the new release copies.

Tests that fail without each fix

New rows build mutated copies of the release. I ran each with its fix reverted in the test only:

  • fix 1 reverted (copied loops): the heavy / model-guard / pc-agents / gh-apps row runs the installer's own missing_sources FAIL (each installer's missing_sources is replaced by one that returns a sentinel, which a copied loop never sees).
  • fix 2 reverted (no copy or stage): a copied heavy script that loads a file the release lacks fails the heavy self-test and the same for desk FAIL.
  • fix 3 reverted (sbin-only, no bootstrap check): a kit folder with only a bootstrap.sh and no row fails and a bootstrap that passes another --source than its row fails FAIL.
  • fix 4 reverted (one advice for all): the no-row, self-test and "installer that cannot run" rows FAIL, because they check that the paths advice is not given.

Kit tests: each of heavy, model-guard and pc-agents gets one test that a source missing a file is refused, naming the file, before anything is written, and that missing_sources of the real kit is []. gh-apps' existing test now also checks missing_sources.

Checks run

  • fork-ci-release.test.py: all passed, 96 ok.
  • heavy install.test.py 17 OK; model-guard install.test.py 37 OK and guard.test.py 97 OK; gh-apps install.test.py 34 OK; pc-agents setup.test.py 61, check.test.py 36 and update.test.py 35 OK; desk install.test.py 58 OK.
  • node .github/scripts/fork-seam-check.cjs --config-ref origin/main origin/main HEAD: 0.
  • vp fmt --check fork-ci/README.md: OK.

State question

  • A kit added later without the helper: if it uses kit_install.py it goes through that path (no helper needed). Otherwise its row must say how its check runs; a new folder with no row fails ("no row in KITS or NO_INSTALLER"), and a row whose installer has no missing_sources fails as "did not run", not as a missing path.
  • A release that runs again: this PR changes only the test and the installers' checks. The release builds the same tree from the same commit and skips. The test writes only to its own temp folder and deletes it at the end. The installers keep their run-again behavior (heavy's copy_tool reuses a complete version folder; missing_sources reads only).
  • An installer stopped half-way: the new checks run before any write, as before (heavy check_options, model-guard install, gh-apps copy_tool, desk install). pc-agents is better than before: a missing code file is now refused before any write, not after part of the copy. heavy's self-test step is the same code moved into a function, at the same step.
  • Old or empty state: an old ci/vN keeps its old tree and old installers; nothing reads the new helpers from outside the release. The test's heavy copy and desk stage run only under a fresh temp PREFIX (never /).

General vs project

General: the release test, the kit installers and the shared bootstrap are fork tooling for any project that installs the kits. No project facts are added. KITS and NO_INSTALLER name this repository's own kit folders, and the release config's first pool is used only for desk's staging self-test.

Fixes #921

🤖 Generated with Claude Code

scuttletoby and others added 2 commits November 22, 2026 10:30
…d copy heavy, notice every kit (#921)

- heavy, model-guard, gh-apps and pc-agents get a missing_sources helper (as desk has); each installer refuses
  with it and the release test calls it, so the test cannot drift from the installer. pc-agents setup now refuses
  a source without a code file before any write (it used to stop half-way through the copy).
- The release test runs heavy's copy and self-test and desk's stage (its self-test) on the release folder under a
  throwaway PREFIX. The staged scripts run with no visible parent, so fork-fleet.py's gate can never find and kill
  the Runner.Worker of the CI job that runs the test.
- Every fork-kit folder needs a row in KITS or NO_INSTALLER, and each row must match what the kit's bootstrap runs
  (installer and --source).
- Failures name their cause: a path missing from the release, a missing or wrong test row, the installer's
  self-test, or a check that did not run. The test removes its temp folder when it ends.

Fixes #921

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@scuttletoby

Copy link
Copy Markdown
Owner Author

lens: merge-path · reviewer: lens agent · read at: 8fa3dda
verdict: safe to merge
covered: the whole diff (release test, heavy/model-guard/gh-apps/pc-agents installers and their tests, fork-ci/README.md); desk-install stage and missing_sources, fork-fleet.py worker_above/stop_job/gate, heavy-install copy_tool/tree_problems as on main after #922, every kit bootstrap.sh, fork-ci-release.yml and where CI runs the release test
checks: ran fork-ci-release.test.py (96 ok, its temp folder is gone afterwards), heavy, model-guard and gh-apps install.test.py and pc-agents setup.test.py (61, all OK) on the head; read CI: the release test ran in "Workflow lint and upstream drift" with the new mutation rows, and that job was not killed by desk's gate
state: runs again: the test writes only to a fresh temp folder (the heavy copy and desk stage under a temp PREFIX) and removes it at exit; the release itself is built by the unchanged fork-ci-release.py from the unchanged paths, so a re-run on the same commit skips as before. Stopped half-way: missing_sources only reads, and each installer still checks before its first write (pc-agents now refuses before any write instead of failing in the middle of the copy). Old or empty state: an old ci/vN keeps its own installers; pc-agents' automatic update (source None) skips the new check and reads its installed folder as before
blocker: none
major: none
minor: the desk stage row stays safe in CI only because fork-fleet.py worker_above reads os.getppid() at call time (.github/scripts/fork-fleet.py:452) and the shim patches exactly that (.github/scripts/fork-ci-release.test.py:455). A later change to the gate (reading /proc/self/stat, or binding getppid at import) would make this test SIGKILL the Runner.Worker of the job that runs it: the job still fails (closed), but with no message and without its if: always() steps. A cheap second guard: the shim also replaces os.kill with one that refuses SIGKILL (raise), so the row fails as "self-test" instead of killing the job.
minor: heavy's self-test, which the test now runs, starts only bin/heavy (fork-kit/heavy/sbin/heavy-install:219-226), not bin/t3-capacity or bin/agent-slots, which heavy-install links into /usr/local/bin since #922. The test agrees with what install does, but the PR text "a copied script that starts loading a file the release lacks now fails here" holds for bin/heavy and desk's scripts only. Not a release-path gap (those scripts read only from the version folder, whose files missing_sources checks); starting bin/t3-capacity in self_test would cover it in install and in this test at once.

@scuttletoby

Copy link
Copy Markdown
Owner Author

lens: state · reviewer: lens agent (Opus) · read at: 8fa3dda
verdict: safe to merge
covered: the whole diff (fork-ci-release.test.py, the heavy, model-guard, gh-apps and pc-agents installers and their tests, fork-ci/README.md), desk-install's stage and py, fork-fleet.py's gate and worker_above
checks: ran fork-ci-release.test.py (96 ok) and the kit tests heavy install (26 OK), model-guard install (37 OK), gh-apps install (34 OK), pc-agents setup (61 OK); stopped the release test with SIGINT and with SIGTERM, each in its own TMPDIR; ran it while another run of the same test was live; listed /tmp before and after; removed the new pc-agents source check and the new pc-agents test failed with the old half-way traceback (FileNotFoundError at setup's copy loop), then restored it
state: runs again: each run makes its own mkdtemp folder and each heavy or desk check its own PREFIX inside it, so two runs at once do not meet (one ran beside another live run: neither touched the other's folder). Stops half-way: a normal end, a failing end and SIGINT remove the run's own folder (tested); SIGTERM leaves it (tested, 23 MB); the cleanup is an rmtree of its own mkdtemp path only, so it never removes another run's folder (42 older leftovers on the test host were all still there after). Old release: an old ci/vN keeps its own installers and nothing outside a release calls the new missing_sources; pc-agents' automatic update (no --source) skips the new check. Empty prefix: PREFIX is always a fresh mkdtemp, never empty, and heavy's copy and desk's stage write only under it (no new /tmp entries from the run)
blocker: none
major: none
minor: SIGTERM skips the cleanup (.github/scripts/fork-ci-release.test.py:45): atexit runs on a normal end, sys.exit and Ctrl-C, not on SIGTERM, which a job timeout, a CI cancel after its SIGINT, or timeout(1) sends; a SIGTERM at 6 s left a 23 MB folder. A SIGTERM handler that calls sys.exit(143) would cover it. The PR body's "deletes its temp folder when it ends" holds except for this
minor: nothing removes earlier runs' leftovers (they stay in /tmp at about 13 MB each); that is right for this PR (never another run's folder), but a later sweep, if wanted, must go by age, not by name
minor: the only thing that stops desk's staged gate from killing the CI job is the python3 shim (.github/scripts/fork-ci-release.test.py:458); if desk-install's py() ever stops going through CMD['python3'], the gate finds the job's Runner.Worker and SIGKILLs it (exit 137, no message saying why). No test row checks that the shim is in the path; one that fails when a staged script sees a real parent would make the break readable

@scuttletoby
scuttletoby merged commit 717901b into main Nov 22, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

#920 follow-ups: release test should call each installer's own checks

1 participant